#include <vector>
using namespace std;
/*
 * @lc app=leetcode.cn id=78 lang=cpp
 *
 * [78] 子集
 */

// @lc code=start
class Solution {
public:
    vector<vector<int>> subsets(vector<int>& nums) {
        vector<vector<int>> res; int sz = nums.size();
        for (int i = 0; i < (1 << nums.size()); i++) {
            vector<int> temp;
            for (int j = 0; j < sz; j++) {
                if (i & (1 << j)) temp.push_back(nums[j]);
            }
            res.push_back(temp);
        }
        return res;
    }
};
// @lc code=end

